import "./App.css";
import Button from "./components/Button";
import { useRequest } from "ahooks";
import fetchData from "./utils/fetchData";
import { usePerformancePlugin } from "./ahooksPlugin";

function App() {
  const { data } = useRequest(
    (id) => fetchData({ params: { id }, timeout: 3000 }),
    {
      defaultParams: [1],
      optName: "appIdle",
    },
    [usePerformancePlugin]
  );

  return (
    <div className="content">
      <div className="body">body</div>
      <div className="footer">
        <Button id={data?.data?.id} />
      </div>
    </div>
  );
}

export default App;
